﻿Public Class TMyDatabase

    Private _Owner As TMyDatabaseList
    Private _DatabaseName As String
    Private _Tables As TMyTables
    Private _Views As TMyViews
    Private _SystemViews As TMySystemViews
    Private _Procedures As TMyProcedures
    Private _Functions As TMyFunctions
    Private _Triggers As TMyTriggers
    Private _Events As TMyEvents

    Public Sub New(ByVal AOwner As TMyDatabaseList, ByVal ADatabaseName As String)
        _Owner = AOwner
        _DatabaseName = ADatabaseName
        _Tables = New TMyTables(Me)
        _Views = New TMyViews(Me)
        _SystemViews = New TMySystemViews(Me)
        _Procedures = New TMyProcedures(Me)
        _Functions = New TMyFunctions(Me)
        _Triggers = New TMyTriggers(Me)
        _Events = New TMyEvents(Me)
    End Sub
    Public ReadOnly Property Events() As TMyEvents
        Get
            Return _Events
        End Get
    End Property
    Public ReadOnly Property Tables() As TMyTables
        Get
            Return _Tables
        End Get
    End Property
    Public ReadOnly Property SystemViews() As TMySystemViews
        Get
            Return _SystemViews
        End Get
    End Property
    Public ReadOnly Property Views() As TMyViews
        Get
            Return _Views
        End Get
    End Property
    Public ReadOnly Property Functions() As TMyFunctions
        Get
            Return _Functions
        End Get
    End Property
    Public ReadOnly Property Procedures() As TMyProcedures
        Get
            Return _Procedures
        End Get
    End Property
    Public ReadOnly Property Triggers() As TMyTriggers
        Get
            Return _Triggers
        End Get
    End Property
    Friend ReadOnly Property MyQuery() As TMyQuery
        Get
            Return _Owner.MyQuery
        End Get
    End Property

    Friend ReadOnly Property Connection() As TMySession
        Get
            Return _Owner.Connection
        End Get
    End Property

    Public ReadOnly Property DatabaseName() As String
        Get
            Return _DatabaseName
        End Get
    End Property
End Class
